from pathlib import Path
def file_size(file_path):
    return file_path.stat().st_size
p = Path('F:\\python\\第1章\\工作信息表')
p_list = list(p.iterdir())
p_list.sort(key=file_size, reverse=True)
for i in p_list:
    print(i.name, file_size(i), 'bytes')
    